package test;

import com.easyaop.api.around.Around;
import com.easyaop.api.around.Call;
import com.easyaop.api.join.JoinPoint;

import java.util.Arrays;

public class MyAround implements Around {
    public static Object object = "obj";

    public static void dfs() {
        System.out.println(1111);
    }

    @Override
    public Object around(Object target, Object[] args, JoinPoint joinPoint, Call call) throws Exception {
//        System.out.println("aop111");
//        joinPoint= Context.getJoinPoint(0);
//        System.out.println(this);
        System.out.println("target : " + target
                + object
        );
        System.out.println("args : " + Arrays.asList(args));
        System.out.println("jp : " + joinPoint);

//        Object a1=args[0];
//        args[1] = null;
//        args=new Object[args.length];

//        System.out.println(a1);

        String around1 = "1222222";
        System.out.println(around1);

//        Runnable dfs = MyAround::dfs;

//        dfs.run();
//        call.call();
//        return call.call();
        try {
//            System.out.println(11);

            Object ret = call.call();
            char around2='j';
            return ret;
        } catch (Exception e) {
//            return null;
            char around3='i';
            return call.call();
        }
//        return ret;
//        return null;
    }
}
